<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title></title>
<meta name="decorator" content="default" />
<style type="text/css">
.form-horizontal .control-label {
	float: left;
	width: 80px;
	padding-top: 5px;
	text-align: right;
}

.form-horizontal .controls {
	*padding-right: 20px;
	*display: inline-block;
	margin-left: 100px;
	*margin-left: 0;
}
</style>
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#inputForm").validate(
						{
							submitHandler : function(form) {
								bossPasswordPopup(function() {
									global.confirm("确认开卡【"
											+ $('#cardName').val() + "】, 剩余 "
											+ $('#cardDuration').val() + "个月?",
											function() {
												form.submit();
											});//confirm
								});
							},
							focusInvalid : false,
							rules : {
								cardDuration : {
									required : true,
									digits : true,
									min : 1,
									max : 100,
								}
							},
							errorContainer : "#messageBox",
							errorPlacement : function(error, element) {
								$("#messageBox").text("输入有误，请先更正。");
								if (element.is(":checkbox")
										|| element.is(":radio")) {
									error.appendTo(element.parent().parent());
								} else {
									error.insertAfter(element);
								}
							},
							messages : {}
						});//validate
				disableExitMenu();
			});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<div class="container">
		<tags:message content="${message}" />
		<div class="icon-buttons">
			<input type="button" data-inline="true" data-icon="back"
				onclick="return directOpenURL('${ctx}/cash/oldcard/cards/add/cardDurationPage')"
				data-iconpos="notext" value="返回" />
		</div>
		<form:form method="post" id="inputForm"
			action="${ctx}/cash/oldcard/cards/add/cardDuration"
			modelAttribute="cardForm">
			<form:hidden path="memberID" />
			<form:hidden path="templateID" />
			<div data-role="fieldcontain">
				<label>卡名</label>
				<form:input type="text" readonly="true" path="cardName" />
			</div>
			<div data-role="fieldcontain">
				<label>护理项目</label>
				<form:input type="text" readonly="true" path="careName" />
			</div>
			<div data-role="fieldcontain">
				<label>护理间隔(天)</label>
				<form:input type="text" readonly="true" path="careDuration" />
			</div>
			<div data-role="fieldcontain">
				<label>时段(月)</label>
				<form:input type="text" path="cardDuration" />
			</div>
			  <div data-role="fieldcontain">
				<label>结束日期</label> <input type="date" id="endDate"
					value="${fns:formatDate(cardForm.endDate,'yyyy-MM-dd')}"
					name="endDate" class="required" />
			</div>
			<div id="okbutton">
				<input type="submit" data-inline="true" value="确认添加" />
			</div>
		</form:form>
	</div>
</body>
</html>
